﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Wicresoft.UnifyShow.Business;
using Microsoft.Practices.Unity;

namespace Wicresoft.UnifyShow.Portal.Controllers
{
    public class BasicMessagePartialViewController : BaseController
    {
        private ISiteBranchAndDeviceAndAlert siteBranchAndDeviceAndAlert;
        private IUser_X user;

        [InjectionConstructor]
        public BasicMessagePartialViewController(IUser_X user, ISiteBranchAndDeviceAndAlert isiteBranchAndDeviceAndAlert)
        {
            siteBranchAndDeviceAndAlert = isiteBranchAndDeviceAndAlert;
            this.user = user;
        }
        protected override void Dispose(bool disposing)
        {
            ((IDisposable)siteBranchAndDeviceAndAlert).Dispose();
            ((IDisposable)user).Dispose();
        }

        public ActionResult BasicMessagePartialView(int siteID, int? businesssystemID)
        {
            base.SetRoles(user);
            int userID = (int)UserID;
            SiteBranchAndDeviceTypeAlertModel model = siteBranchAndDeviceAndAlert.getSiteBranchAndDeviceAndAlert(siteID, businesssystemID, userID);
            return PartialView(model);
            
        }

    }
}
